package comtwo.servlet;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("mystudent")
public class student {
    @Value("1001")
    private int id;
    @Value("李四")
    private String name;
    @Value("23")
    private int age;
    @Autowired
    @Qualifier("myschool")
    private comtwo.servlet.school school;

    public comtwo.servlet.school getSchool() {
        return school;
    }

    public void setSchool(comtwo.servlet.school school) {
        this.school = school;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public student() {
    }

    public student(int id, String name, int age,
                   comtwo.servlet.school school) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.school = school;
    }

    @Override
    public String toString() {
        return "student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", school=" + school +
                '}';
    }
}
